home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
0007.ZIP
/
FIND-DS.BAS
< prev
next >
Wrap
BASIC Source File
|
1983-11-29
|
640b
|
19 lines
1 REM this finds the value of BASIC/BASICA'S data segment. useful for determining
2 REM absolute location of a variable, file buffer, etc.
3 REM
4 REM Mark Minasi 5400 Wilson Blvd, Arl. VA 22205 (703) 276-0170
5 REM
6 REM as usual, don't use for profit...
7 REM
10 DEF SEG
20 X=0:SUBRT=0:I=0:J=0:A%=0
30 REM finds the data segment
40 DIM CODE(40)
50 SUBRT=VARPTR(CODE(0))
60 X=(SUBRT+16) MOD 16
70 SUBRT=SUBRT+16-X
80 FOR I=0 TO 13:READ J:POKE SUBRT+I,J:NEXT
90 DATA &h55,&h8c,&hd8,&h89,&he5,&h8b,&h7e,&h06,&h89,&h05,&h5d,&hca,&h02,&h00
100 CALL SUBRT(A%) 'give back ds
110 PRINT "data segment=";HEX$(A%)